import request from '@/utils/request';

//获得 banner 列表
export const bannerList = (params : any) => {
	return request({
		url: '/app-api/promotion/banner/list',
		method: 'GET',
		body: params,
		hideLoading: false,
	});
};
//什么能吃 - 分类
export const foodCategory = (params : any) => {
	return request({
		url: '/app-api/system/food/category',
		method: 'GET',
		body: params,
		hideLoading: false,
	});
};
//什么能吃详情
export const foodDetail = (params : any) => {
	return request({
		url: '/app-api/system/food/detail',
		method: 'GET',
		body: params,
		hideLoading: false,
	});
};
//什么能吃搜索
export const foodSearch = (params : any) => {
	return request({
		url: '/app-api/system/food/search',
		method: 'POST',
		body: params,
		hideLoading: false,
	});
};
//什么能做 - 搜索
export const behaviorQuery = (params : any) => {
	return request({
		url: '/app-api/system/behavior/query',
		method: 'POST',
		body: params,
		hideLoading: false,
	});
};
//什么能做 - 详情
export const behaviorDetail = (params : any) => {
	return request({
		url: '/app-api/system/behavior/detail',
		method: 'GET',
		body: params,
		hideLoading: false,
	});
};
//什么能做 - 分类
export const behaviorCategory = (params : any) => {
	return request({
		url: '/app-api/system/behavior/category',
		method: 'GET',
		body: params,
		hideLoading: false,
	});
};
//关键词搜索获得药品列表(宠物慎用-禁用药品列表)
export const medicineSimpleQuery = (params : any) => {
	return request({
		url: '/app-api/system/medicine/simple/query',
		method: 'POST',
		body: params,
		hideLoading: false,
	});
};
//根据id获得药品详情
export const medicineDetail = (params : any) => {
	return request({
		url: '/app-api/system/medicine/detail',
		method: 'GET',
		body: params,
		hideLoading: false,
	});
};
//app 医生搜索分页
export const doctorPage = (params : any) => {
	return request({
		url: '/app-api/member/doctor/page',
		method: 'POST',
		body: params,
		hideLoading: false,
	});
};
//app 我的匹配医生
export const matchDoctor = (params : any) => {
	return request({
		url: '/app-api/consultation/order/myDoctor',
		method: 'GET',
		body: params,
		hideLoading: false,
	});
};
//app 医生详情
export const doctorDetail = (params : any) => {
	return request({
		url: '/app-api/member/doctor/detail',
		method: 'GET',
		body: params,
		hideLoading: false,
	});
};

//获得疾病分页
export const diseasePage = (params : any) => {
	return request({
		url: '/app-api/system/disease/page',
		method: 'POST',
		body: params,
		hideLoading: false,
	});
};
//获得不同类型分类列表
export const categoryList = (params : any) => {
	if (params.type) {
		params.types = params.type
	}
	return request({
		url: '/app-api/system/category/list',
		method: 'GET',
		body: params,
		hideLoading: false,
	});
};
//获得不同父分类编号对应的分类列表
export const listParentcodes = (params : any) => {
	return request({
		url: '/app-api/system/category/list/parentcodes',
		method: 'POST',
		body: params,
		hideLoading: false,
	});
};

//医生咨询
export const orderConsult = (params : any) => {
	return request({
		url: '/app-api/consultation/order/consult',
		method: 'POST',
		body: params,
		hideLoading: false,
	});
};

//问诊评价搜索分页
export const commentPage = (params : any) => {
	return request({
		url: '/app-api/consultation/comment/page',
		method: 'POST',
		body: params,
		hideLoading: false,
	});
};

//问诊订单搜索分页
export const orderPage = (params : any) => {
	return request({
		url: '/app-api/consultation/order/page',
		method: 'POST',
		body: params,
		hideLoading: false,
	});
};

//问诊订单详情
export const orderDetail = (params : any) => {
	return request({
		url: '/app-api/consultation/order/detail',
		method: 'GET',
		body: params,
		hideLoading: false,
	});
};

//添加评价
export const orderCommentAdd = (params : any) => {
	return request({
		url: '/app-api/consultation/comment/comment',
		method: 'POST',
		body: params,
		hideLoading: false,
	});
};

//删除订单
export const orderDelte = (id : number) => {
	return request({
		url: '/app-api/consultation/order/del/' + id,
		method: 'POST',
		hideLoading: false,
	});
};

//社交绑定
export const socialUser = (data : any) => {
	return request({
		url: '/app-api/member/auth/social-login',
		method: 'POST',
		body: data,
		hideLoading: false,
	});
};
//社交绑定
export const createComment = (data : any) => {
	return request({
		url: '/app-api/order/item/batch/create-comment',
		method: 'POST',
		body: data,
		hideLoading: false,
	});
};
//实名认证
export const realNameAuth = (data : any) => {
	return request({
		url: '/app-api/member/user/realName-auth',
		method: 'PUT',
		body: data,
		hideLoading: false,
	});
};
export const realNameAuthRZ = (data : any) => {
	return request({
		url: '/app-api/member/doctor/realNameAuth',
		method: 'PUT',
		body: data,
		hideLoading: false,
	});
};
export const optioncreate = (data : any) => {
	return request({
		url: '/app-api/system/option/create',
		method: 'POST',
		body: data,
		hideLoading: false,
	});
};
export const getexpress = (data : any) => {
	return request({
		url: '/app-api/order/get-express-track-list',
		method: 'GET',
		body: data,
		hideLoading: false,
	});
};
export const storepage = (data : any) => {
	return request({
		url: '/app-api/product/service/store/page',
		method: 'POST',
		body: data,
		hideLoading: false,
	});
};



export const  formatTimestamp=(timestamp:number)=>{
    // 创建一个新的Date对象并传入时间戳作为参数
    const date = new Date(timestamp);
    
    // 获取年、月、日等信息
    const year = date.getFullYear();
    const month = (date.getMonth() + 1).toString().padStart(2, '0');
    const day = date.getDate().toString().padStart(2, '0');
    const hours = date.getHours().toString().padStart(2, '0');
    const minutes = date.getMinutes().toString().padStart(2, '0');
    const seconds = date.getSeconds().toString().padStart(2, '0');
  
    // 返回格式化后的日期字符串
    return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
  }
///app-api/order/cart/get-count


